<?php
if (!defined('CURRENT_PATH')){
	die('Hacking attempt');
	}
$page=isset($_GET[page])?$_GET[page]:1;
$ps=spClass(product_summary);
$res=$ps->spPager($this->spArgs('page', $page),10)->findAll($conditions,$sort='show_order desc,product_add_time desc');
//dump($res);
	$ct=spClass("category");
	$result=$ct->findAll('','sid desc',$fields='id,datil');
	$temp=array();
	foreach($result as $id=>$v){
		$temp[$v['id']]=$v['datil'];		
		}
	$result=$temp;	
	$temp=null;
foreach($res as $id => $v){	
		$result[$res[$id][fid]]['datil'];
		$res[$id][fid]=$result[$res[$id][fid]];
	}
$this->res=$res;
$this->pager=$ps->spPager()->getPager();
$this->mod=$this->spArgs('mod').'&cat='.$this->spArgs('cat');
$this->display('management/product_list.html');